/*
 * Copyright (C) 2016 yixun All Rights Reserved.
 * 
 * ImgTypeEnum.java
 */
package com.emm.yixun.common.model.enums;
import java.io.Serializable;
import org.apache.commons.lang.StringUtils;
/**
 * [文件名称]<br>
 * ProjectInfo.java<br>
 * <br>
 * [文件描述]<br>
 * 房产项目信息 pojo bean<br>
 * <br>
 * [修改记录]<br>
 * 2016-05-11 11:27:20 创建<br>

 * @version 1.00
*/
public enum RecommendedCategoryEnum implements Serializable{
		FXORZJ("1","分销/中介",null),
		LKH("2","老客户(未成交客户)",null),
		LYZ("3","老业主",null),
		;
		
		private final String no;
		private final String des;
		private final Enum parent;
		
		/**
		 * 私有构造函数
		 * @param code
		 * @param description
		 */
		RecommendedCategoryEnum(String no, String des,Enum parent) {
			this.no = no;
			this.des = des;
			this.parent = parent;
		}

		/**
		 * @return Returns the no.
		 */
		public String getNo() {
			return no;
		}

		/**
		 * @return Returns the des.
		 */
		public String getDes() {
			return des;
		}
		
		/**
		 * @return Returns the parent.
		 */
		public Enum getParent() {
			return parent;
		}

		/**
		 * 通过枚举<code>des</code>获得枚举
		 * 
		 * @param des
		 * @return
		 */
		public static RecommendedCategoryEnum getByDescription(String des) {
			if(StringUtils.isBlank(des)){
				return null;
			}
			for (RecommendedCategoryEnum menum : values()) {
				if (menum.getDes().equals(des)) {
					return menum;
				}
			}
			return null;
		}
		public static RecommendedCategoryEnum getByNo(String no) {
			if(StringUtils.isBlank(no)){
				return null;
			}
			for (RecommendedCategoryEnum menum : values()) {
				if (menum.getNo().equals(no)) {
					return menum;
				}
			}
			return null;
		}
}
